package code.framework.android.view;

import android.webkit.WebView;
import code.framework.android.core.ApplicationContext;

public class ViewHelper {

	public static void loadWebView(String api, String data, WebView webView) {
		webView.loadDataWithBaseURL(api, data, ApplicationContext.MIME_TYPE,
				ApplicationContext.CHAR_ENCODING, null);
		webView.getSettings().setJavaScriptEnabled(false);
		webView.setFocusable(true);
		webView.setFocusableInTouchMode(true);
		webView.requestFocus();
	}

	public static void loadWebView(String api, byte[] data, WebView webView) {
		webView.loadDataWithBaseURL(api, new String(data),
				ApplicationContext.MIME_TYPE, ApplicationContext.CHAR_ENCODING,
				null);
		webView.getSettings().setJavaScriptEnabled(false);
		webView.setFocusable(true);
		webView.setFocusableInTouchMode(true);
		webView.requestFocus();
	}

}
